#ifndef INDEXED_SHAPE_SHOWER_H
#define INDEXED_SHAPE_SHOWER_H

#include <QWidget>
#include <QSpinBox>
#include <common/Palette.h>
#include <shp/Shp.h>
#include <memory>

class IndexedShapeShower : public QWidget
{
Q_OBJECT
public:
    explicit IndexedShapeShower(const std::shared_ptr<IPalette>& i, QWidget* parent = nullptr);
    void SetPalette(const std::shared_ptr<IPalette>& pal);
    void SetShp(const std::shared_ptr<Shp>& shp_);

private:
    QSpinBox* spinBox = nullptr;
    size_t index = 0;
    std::shared_ptr<IPalette> palette = nullptr;
    std::shared_ptr<Shp> shp = nullptr;

    QPixmap img;

    void paintEvent(QPaintEvent *e) final;
};

#endif //INDEXED_SHAPE_SHOWER_H
